package com.medical.controller;

import com.medical.pojo.DailyConsumption;
import com.medical.pojo.DailyVO;
import com.medical.service.DailyConsumptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/daily")
public class DailyConsumptionController {

    @Autowired
    private DailyConsumptionService dailyConsumptionService;

    @RequestMapping("/findAll")
    public List<DailyConsumption> findAll(@RequestBody DailyVO dailyVO){
        return dailyConsumptionService.findAll(dailyVO);
    }

    @RequestMapping("/findJoint")
    public List<String> findJoint(@RequestBody DailyVO dailyVO){
        return dailyConsumptionService.findJoint(dailyVO);
    }

    @RequestMapping("/findUsage")
    public List<String> findUsage(@RequestBody com.medical.pojo.DailyVO dailyVO){
        return dailyConsumptionService.findUsage(dailyVO);
    }
}
